package com.vcourse.cloud.vod.api.feign;

import com.vcourse.cloud.vod.api.feign.falllback.VodMediaServiceFallBack;
import com.vcourse.commons.result.R;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author Zengsh123
 * @date 2020-06-16 22:04
 */
@Service
@FeignClient(value = "cloud-vod", fallback = VodMediaServiceFallBack.class)
public interface VodMediaService {

    @DeleteMapping("/admin/vod/media/remove/{vodId}")
    R removeVideo(@PathVariable("vodId") String vodId);

    @ApiOperation("批量删除视频")
    @DeleteMapping("remove")
    R removeVideoByIdList(
            @ApiParam(value = "阿里云视频id列表", required = true)
            @RequestBody List<String> videoIdList);

    @ApiOperation("获取视频播放凭证")
    @GetMapping("get-play-auth/{videoSourceId}")
    R getPlayAuth(
            @ApiParam(value = "阿里云视频文件的id", required = true)
            @PathVariable String videoSourceId);
}
